import socket
import threading


if __name__ == '__main__':

    # 创建socket  并且socket.AF_INET代表是ipv4   socket.SOCK_STREAM代表是tcp协议


    for i in range(5):
        socTest = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        socTest.connect(("127.0.0.1", 8080))
        socTest.send(f"hay:{i}".encode())
        re = socTest.recv(1204)
        print(re.decode())
    socTest.close()